function updateClock(){
    var now = new Date();
    var hour = now.getHours();
    var minute = now.getMinutes();
    var second = now.getSeconds();
    hour=hour % 12;
    minute=minute % 12;
    second=second % 12;
   document.getElementById('hour').textContent=hour;
   document.getElementById('minutes').textContent=minute;
   document.getElementById('second').textContent=second;
}
setInterval(updateClock,1000);